/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;

/**
 *
 * @author Alberto, Alessandra
 */
public class WeatherConverter {
    
    public static Weather convertToWeatherEnum(Integer code){
        if(code>= 200 && code <= 202) return Weather.THUNDERSTORM;
        if(code>= 210 && code <= 212 ) return Weather.THUNDERSTORM;
        if(code == 221) return Weather.THUNDERSTORM;
        if(code>= 230 && code <= 232) return Weather.THUNDERSTORM;
        if(code>= 300 && code <= 302) return Weather.RAINY;
        if(code>= 310 && code <= 314) return Weather.RAINY;
        if(code>= 500 && code <= 504) return Weather.RAINY;
        if(code>= 520 && code <= 522) return Weather.RAINY;
        if(code == 321) return Weather.RAINY;
        if(code == 511) return Weather.RAINY;
        if(code == 531) return Weather.RAINY;
        if(code>= 600 && code <= 602 ) return Weather.SNOWY;
        if(code>= 611 && code <= 612 ) return Weather.SNOWY;
        if(code>= 615 && code <= 616 ) return Weather.SNOWY;
        if(code>= 620 && code <= 622 ) return Weather.SNOWY;
        if(code == 701) return Weather.FOGGY;
        if(code == 711) return Weather.FOGGY;
        if(code == 721) return Weather.FOGGY;
        if(code == 731) return Weather.FOGGY;
        if(code == 741) return Weather.FOGGY;
        if(code == 751) return Weather.FOGGY;
        if(code == 761) return Weather.FOGGY;
        if(code == 762) return Weather.FOGGY;
        if(code == 771) return Weather.FOGGY;
        if(code == 781) return Weather.FOGGY;
        if(code>= 800 && code <= 802 ) return Weather.SUNNY;
        if(code == 803) return Weather.CLOUDY;
        if(code == 804) return Weather.CLOUDY;
        else return null;                                   
    }
}
